package com.lut.utils;

import org.apache.commons.beanutils.BeanUtils;

import java.util.Map;

/**
 * @user:dell
 * @date:2020年10月09 19:55
 */
public class WebUtils  {
    public static <T> T copyParamToBean(Map value, T bean){
        try {
            BeanUtils.populate(bean,value);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bean;
    }
    public static int ParseInt(String strInt,int defaultValue) {

        try {
            return Integer.parseInt(strInt);
        } catch (Exception e) {
//            e.printStackTrace();
        }
        return defaultValue;
    }
 }
